{% set clazz = "confirm" %}
{% set title = "确认兑换" %}
{% extends './modules/common/templates/main.html' %}
{% block style %}
  <link rel="stylesheet" type="text/css" href="{{ '/static/css/integral.css'|version }}" />
{% endblock %}
{% block content %}
  {% if !nested %}
    <header class="bar bar-header">
      {{ macro.back() }}
      <h1 class="title">{{ title }}</h1>
    </header>
  {% endif %}
  <section class="has-footer">
    <div class="list compact overlap">
      <div class="item" ui-mode="30px">
        <div class="avatar">
          <img class="round" src="{{ goods.entity.imageSrcList[0]|thumb(80, 80) }}" ui-mode="80px" />
        </div>
        <span class="text">
          {{ goods.entity.goodsName }} <i class="text-orange">({{ goods.entity.consumeIntegral }}积分)</i>
          <div class="brief">数量：1</div>
        </span>
      </div>
    </div>
    {% if goods.entity.goodsType == 'ENTITY' %}
      {% if address %}
        <div id="address" class="list" data-consignee="{{ address.name }}" data-consignee-mobile="{{ address.mobile }}" data-consignee-address="{{ address.address }}">
          <a class="item" href="/integral/addresses">
            <i class="icon text-orange">&#xe60d;</i>
            <span class="text">
              {{ address.name }}
              <p class="brief"><span>地址：{{ address.address }}</span></p>
            </span>
            <i class="icon text-gray">&#xe61a;</i>
          </a>
        </div>
      {% else %}
        <div class="list">
          <a class="item" href="/integral/address">
            <i class="icon text-orange">&#xe60d;</i>
            <span class="text">
              <span class="text-sm text-gray">请选择收货地址</span>
            </span>
            <i class="icon text-gray">&#xe61a;</i>
          </a>
        </div>
      {% endif %}
    {% endif %}
  </section>
  <footer class="bar bar-footer bar-fixed bar-flat">
    <div class="flexbox">
      <div class="item">
        <div class="hspace text-nm">
          应付：<span class="text-orange">{{ goods.entity.consumeIntegral }}积分</span>
        </div>
      </div>
      <div class="item">
        <button id="submit" class="button warning square" data-goods-id="{{ goods.entity.id }}" data-goods-type="{{ goods.entity.goodsType }}">立即兑换</button>
      </div>
    </div>
  </footer>
{% endblock %}
{% block script %}
  {% parent %}
  <script src="{{ '/static/js/integral.js'|version }}"></script>
{% endblock %}